package com.feib.soeasy.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.feib.soeasy.dao.CodeTableDao;
import com.feib.soeasy.model.CodeTable;
import com.feib.soeasy.service.CodeTableService;


/**
 * @title (#)CodeTableServiceImpl.java<br>
 * @description 代碼表邏輯物件<br>
 * @author Jimmy Liu<br>
 * @version 1.0.0 2010/11/25
 * @copyright Far Eastern International Bank Copyright (c) 2010<br>
 * @2010/11/15 create by Jimmy Liu<br>
 */
@Service("codeTableService")
public class CodeTableServiceImpl extends BaseServiceImpl implements CodeTableService {

    @Resource(name="codeTableDao")
    private CodeTableDao codeTableDao;
    
    /* (non-Javadoc)
     * @see com.feib.soeasy.service.CodeTableService#queryByCodeKind(java.lang.String)
     */
    @Override
    public List<CodeTable> queryByCodeKind(String codeKind) {
        return codeTableDao.findByCodeKind(codeKind);
    }

	@Override
	public String getCodeName(String codeKind, String codeValue) {
		CodeTable codeTable = codeTableDao.getCodeTable(codeKind, codeValue);
		if(codeTable != null)
			return codeTable.getCodeName();
		return null;
	}

}
